import {MessageBox} from 'element-ui';
import {delay} from '@/util';

export default function(message, timeout = 3000) {
  MessageBox({
    message,
    customClass: 'sh-message-box',
    showClose: false,
    showCancelButton: false,
    showConfirmButton: false,
    closeOnClickModal: true,
    closeOnPressEscape: false
  });
  return delay(timeout).then(MessageBox.close);
}
